home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Free 21
/
Commodore_Free_Issue_21_2008_Commodore_Computer_Club.d64
/
t.b guide 6.1
< prev
next >
Wrap
Text File
|
2023-02-26
|
11KB
|
379 lines
u
In the Beginning Part 6
\Lord Ronin from Q-Link\
Chapter 6, Section 2
That was a lot to present. Now we are
at the last file for this disk side.
We are going back to the manual and
the bits on introducing the user to
Basic v2 programming.
Remember that you can use the '?' to
replace the word print.
Lets mess with a few keys. We did
editing a bit already. Did a bit on
the print thing. Lets mess a bit more
with the print thing. So type in the
following or something close to it.
10?"commodore", <yeah put in the comma
and then press return>
20goto 10 <return again>
Now type RUN. Or if you are close to
being as lazy as me. Just type R and a
shifted U. The U will be that quarter
circle on the right side of the U key.
If you are in upper case. If in lower
case
it will look on the screen as rU. That
is the short hand programmers way of
telling the computer to run. Do need
to press
return.
You now have four commodore across
the screen running on forever until
you press the run/stop key. Do that
and then on line 10 of the programme.
Delete the comma and run it again.
Remember to press return on the line.
that locks in what you write or edit.
No return and it keeps what was there
or doesn't record it to memory.
What you now have is a string down
the left side of the C= saying
commodore. Or what ever you put in
there. Only difference is the comma.
Oh yeah press run/stop to stop that or
it will go on
forever.
A few things to see about this right
now. That comma made the print on the
screen come out in 4 per a line. Less
if you wrote more characters in the
word to be printed. This is setting
the print
to each of the 4 groups, or tabs at
the 10 space mark of the 40 characters
on the screen line. No comma and it
just does one line.
Next is seeing that a computer
programme is more literal than me. It
will operate from the lowest number
line to the highest. Unless some other
command moves it to a new location in
the programme. In this instance it is
the goto command. Telling the computer
to print line 10. Then on 20 it is
telling it to return to line 10. Do
the action there and when it
automatically drops to line 20. As the
programme will drop to the next
command line after performing the
previous line function. The function
on line 20 tells it to go back to 10.
We have a forever loop here. Not a
real great programme. Element of it is
used a lot in programming.
Book takes us to the "Variables"
next. Sort of like the math term, if
you went into algebra and trig. If not
then this may actually be easier for
you. Learning the terms without
preconceived notions of the meanings.
A variable is a something that can
change in the course of the operation
of the programme. It is also a holder
of a something. And if you understand
that explanation you are much better
than me.
V=9.23
V%=100
V$="since 1978ce I've played AD&D"
That is a light hearted look at the
three types of variables in the C=.
First one V=9.25 uses a floating
point. You get the decimal part of the
number. V%=100 will give you what they
call the integer number. No decimal
point. V$= well the text that I wrote
in the quotes. Is called a "string".
OK full title is a text string. But I
know of no one that calls it that.
According to the book these are memory
locations in the computer. No I don't
understand that at all. Said I was a
lamer at programming. And at this
point in time that bit isn't important
for you to use the C=. Just telling
you what the book says.
A programme they give you to type in
to understand this variable part is..
10X%=15
20X=23.5
30X$="THE SUM OF X%+X ="
Note that the actual math computation
is not in the programme lines. This is
to show you the things of or for a
variable.
10X%=15
20X=23.5
30D=X%+X
40X$="THE SUM OF X%+X ="
50?X$,D
Might work, I just came up with that
lay out to show you some points we
will deal with in the future.
Basically what we have done in the
above is to define the floating, the
integer and the text.
Then add the math part. Giving it a
new variable lable. Line 50 is
supposed to print out the text and
then the actual result. Here is one
based on the Commodore programme
lesson book.
10Z$="CAT"
20A$="BOX"
30?Z$+A$
Now if I remember that correctly the
print will print out the word "catbox"
on the screen. Just showing you how
variables can be combined in a
programme.
Before we go any farther along. There
are some things we will be doing in
typing in a programme. You may want to
save these to disk or tape for later.
Tape users, make certain that there is
nothing on the tape you want to save.
I personally take a pencil, ah the
standard wooden one, and put it in the
hole. Slowly twisting the wheel till
the leader tape is past the cotton
pad. That way you know that you are
going to be on recordable media when
you start to save. Saving the
programme to tape goes this way. You
type
SAVE"name you give it" note that the
name can not be longer than 16
characters
After hitting return. You will see on
the screen
PRESS PLAY AND RECORD ON TAPE
Do that and the screen goes blank.
Becoming, or so it says the same
colour as the border. Tape takes some
time, but when it is finished. You
will get that READY prompt on the
screen.
Now disk users. You have a little bit
more to work with at this point in
time. First do you have a disk that
you can use? Before you answer that
one. Take a moment to reflect. If you
are like most people I have started
off on the C=. Your set up is used and
there may be a hundred disks. Which
one to use? Well if you have some that
are unused. That is great. Those are
the ones that when you do a directory
listing. Come up with nothing. Just an
error. Remember that you type in LOAD,
wait a moment lets get lazy and do the
short cut. That is the L and the
shifted O. Symbol for that in upper
case is that upper left angle on the
right of the key. In lower case it
would look like lO. Now if you have
jiffy dos it is just the F1 key. If
you have a cart like the MACH or the
TURBO and there are some others. Try
just the $ symbol for the directory.
Those that are stock. The command is
lO"$",8 then press return. That lO is
the short form load command. The ""
part is the border for the item to be
loaded. Since the $ is in that
bordered area. You are loading the $
or the directory of the disk. Comma
separate and the 8 is the device
number. Once that is done, press LIST
or the short form of L and a shifted
I. In upper case it is the right upper
circle part on the I key. In lower
case it looks like lI.
If the directory lists the things I
mentioned in an earlier installment.
Then put it off to the side. If it
doesn't do a thing and sits there
after some scary noises from the
drive. There is a good chance it is a
blank unformatted disk.
Guess it is now time to go into some
of the stuff on a disk. Factory disks
had a nice lable put on them. Which
also has a tendency to fall off over
time. So there may not be a lable on
the disk. But it is a factory disk.
Looking at the directory. Seeing the
listing of the files and the reverse
video bar above it with the title and
the 2 character id code. Well that can
help you decide if it is a good to use
or not disk. Not the id code as much
as the disk name. I have seen on
factory disks for id codes. Well
things like "s1" or "sa" to indicate
the first side. I have seen them use
"00" and "01" to indicate the sides.
And other forms that are simple that
many beginners use for their own
disks. Some I have seen use a name in
up to 5 charcters. This isn't a sign
of a factory disk. I have a small tool
that lets me make 5 character id
codes. What you are looking for more
is the name that the disk was given.
Certain non media broadcastable words,
are a big clue that the disk isn't
factory. "GREG'S STUFF" is another
type of clue.
I'm going into great detail and pains
on this one. At your beginning level,
well honestly you don't know what you
have or how to use it. You could
destroy a disk of important tools and
utilities that you would or could want
in the future. Trust me on this one, I
have done it in the past more times
that I want to admit.
If you have unformatted disks. The
ones that made the drive make haunted
house noises and then did an error
thing. Then you need to format it. If
not then we have a couple of things to
do at this point. One is to knowthat
you can buy 5 1/4 inch disks. There
are some companies that sell new ones
online. Places like ebay have some
from time to time for sale. Just need
to look around. I scored some up from
a computer repair shop and from a
close out at stationary store.
Remember that you want double sided
double density and soft sectored.
Lets take a look at the disks that
you put in that pile of "I don't know
what the smeg they are." Odds are that
there are a few of them with very
little on them. You see some of the
games, want you to have a save disk.
So the previous owner took a disk.
Stuck it in the machine and had the
game programme format it for him. This
saves his game in progress. In fact on
some you can save multiple games. But
the point is that the disk is
formatted. Most of the time it will
work as stock.
But I have to say here that there were
some that did a non standard format
for the game. I haven't found many of
that sort thatwould read right on a
directory search. Well there could be
200 of more blocks free on the disk.
When you save, unless you use the same
name as an existing file. The disk
drive micro processor checks for
names, and for space. So it won't
write over anything existing.
Another thing that you might see and
I mentioned lightly earlier. You disk
may have only one side with that
square type notch. I have taken in
collections that way. Here we need to
be careful. The disk could be a
factory that uses side two as a read
only disk. In fact if you have disks
with no notches at all. Most likely
you have a factory disk. That notch
hole allows you to write to the disk.
No notch, no writing. Sub note, there
are ways around that fact.
Speaking of that before we go
farther. You may find disks that have
a bit of tape over the notch. These
can be black the most common, white
and a silver one. That last one is in
some machines worthless. Reflecting
the beam back and has been known to
fake the drive into thinking there is
a notch. Disk boxes from the store had
labels, the disks of course and a
sheet of these notch covers.
Over time they dry out and slip up.
Making a mess in the drive and hard to
insert. Labels do the same thing, if
not well placed on the disk. Well that
disk notch cover means that the data
was important to the previous user.
Doesn't mean that it is important to
you. But leave that disk to the side.
Might have some things that you need
later on.
Continued in Section 2